package com.fg.cloud.wechar.controller.system;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fg.cloud.common.StatusCode;
import com.fg.cloud.common.quantity.ResultType;
import com.fg.cloud.manager.service.factory.FactoryImagesService;
import com.fg.cloud.wechar.controller.BaseWeCharController;

/**
 * Description:厂商信息显示
 * 
 * @author shaoqiping
 * @date 2017年8月15日下午6:25:29
 */
@Controller
@RequestMapping("/ageSystem")
public class SystemImagesController extends BaseWeCharController{
	

	@Autowired
	private FactoryImagesService imagesService;
	
	/**
	  * Description:广告轮播图
	  * @param request
	  * @param response
	  * @author shaoqiping
	  * @date 2017年9月4日上午11:15:28
	*/
	@RequestMapping("/facPics")
	@ResponseBody
	public void facPic(HttpServletRequest request, HttpServletResponse response) {
		try {
			doResult(response, true, StatusCode.FINDSUCCESS, imagesService.findAds(getCurrentAgencyUser().getFacId()), ResultType.FIND_SUCCESS);
		} catch (Exception e) {
			e.printStackTrace();
			doResult(response, false, StatusCode.EXCEPTIONERROR, null, e.getMessage());
		}
	}
}
